wayland: Only bind supported unstable pointer gestures global
authorJonas Ådahl <jadahl@gmail.com>
Thu, 20 Aug 2015 03:38:43 +0000 (11:38 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 21 Aug 2015 02:04:02 +0000 (10:04 +0800)
As the protocol is still considered unstable (meaning not backward
compatible), we should, as stated in the protocol, only bind the version
advertised is the version we implement.

https://bugzilla.gnome.org/show_bug.cgi?id=753856

gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkdisplay-wayland.h

index 32a0583390e3e9c7dc522196a0aa07c9d42bd62f..d1c58deac768970f81c4321469e2466f710d01ae 100644 (file)
@@ -358,10 +358,12 @@ gdk_registry_handle_global (void               *data,
       display_wayland->subcompositor =
         wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
     }
-  else if (strcmp (interface, "_wl_pointer_gestures") == 0)
+  else if (strcmp (interface, "_wl_pointer_gestures") == 0 &&
+           version == GDK__WL_POINTER_GESTURES_VERSION)
     {
       display_wayland->pointer_gestures =
-        wl_registry_bind (display_wayland->wl_registry, id, &_wl_pointer_gestures_interface, 1);
+        wl_registry_bind (display_wayland->wl_registry,
+                          id, &_wl_pointer_gestures_interface, version);
     }
   else
     handled = FALSE;
index b834fd763eb1bb85a50dfee1ac632afc16ab5318..4156bc6288fdbdf2edb4145e83afdf5fa4bf772b 100644 (file)
@@ -45,6 +45,8 @@ G_BEGIN_DECLS
 #define GDK_WAYLAND_MAX_THEME_SCALE 2
 #define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
 
+#define GDK__WL_POINTER_GESTURES_VERSION 1
+
 typedef struct _GdkWaylandSelection GdkWaylandSelection;
 
 struct _GdkWaylandDisplay